package com.ms.game.invitefriend;

import com.ms.game.invitefriend.message.CGetDownlineCommInfoRequest;
import com.ms.game.invitefriend.message.CGetSubDistributorsInfoRequest;
import com.ms.game.invitefriend.message.CModifySubDistributorCommSetting;
import com.ms.game.lobby.GameLobbyModule;
import com.xpec.c4.message.MessageTypes;
import com.xpec.c4.service.annotations.MessageType;
import com.xpec.c4.service.common.BaseMessageAction;
import com.xpec.c4.service.contexts.Contexts;

public class InviteCodeAction extends BaseMessageAction{
	
	/**
	 *	取得邀請碼
	 */
	@MessageType(typeCode = MessageTypes.C_LOBBY_GET_INVITE_CODE_REQUEST)
	public void getInviteCode(Object object){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		InviteCodeProcessor.getInviteCode(module, sessionID);
	}
	
	/**
	 *	取得經銷商邀請碼
	 */
	@MessageType(typeCode = MessageTypes.C_INVITE_CODE_GET_DISTRIBUTOR_INVITE_CODE_REQUEST)
	public void getDistributorInviteCodes(byte limitCount){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		InviteCodeProcessor.getDistributorInviteCode(limitCount, module, sessionID);
	}
	
	/**
	 *	修改子經銷商設定
	 */
	@MessageType(typeCode = MessageTypes.C_INVITE_CODE_MODIFY_DISTRIBUTOR_COMM_SETTING_REQUEST)
	public void modifySubDistributorCommSetting(CModifySubDistributorCommSetting request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		InviteCodeProcessor.modifySubDistributorCommSetting(request, module, sessionID);
	}
	
	/**
	 *	取得所有子經銷商資訊
	 */
	@MessageType(typeCode = MessageTypes.C_INVITE_CODE_GET_SUB_DISTRIBUTOR_INFO_REQUEST)
	public void getSubDistributorsInfo(CGetSubDistributorsInfoRequest request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		InviteCodeProcessor.getSubDistributorsInfo(request, module, sessionID);
	}
	
	/**
	 * 取得下線的資訊
	 * @param request
	 */
	@MessageType(typeCode = MessageTypes.C_INVITE_CODE_GET_DOWNLINE_COMM_REQUEST)
	public void getDownlineCommInfo(CGetDownlineCommInfoRequest request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		InviteCodeProcessor.getDownlineCommInfo(request, module, sessionID);
	}
	
	
}
